server {
  listen 80;
  listen [::]:80;
  server_name greatful.com.br;

  #return 301 https://greatful.com.br$request_uri;
  root /var/www/great-landing;
  index index.html index.htm;
  location ~ /\.ht {
    deny all;
  }
}

server {
  listen 80;
  listen [::]:80;
  server_name *.greatful.com.br;

  return 301 http://greatful.com.br$request_uri;
}

server {
  listen 443 ssl;
  listen [::]:443 ssl;
  ssl_protocols TLSv1.2; # nginx v1.10.3
  ssl_prefer_server_ciphers on;
  #ssl_dhparam /etc/nginx/dhparam.pem;
  ssl_ciphers EECDH+AESGCM:EDH+AESGCM;
  ssl_ecdh_curve secp384r1;
  ssl_session_timeout  10m;
  ssl_session_cache shared:SSL:10m;
  ssl_session_tickets off;
  ssl_stapling on;
  ssl_stapling_verify on;
  resolver 208.67.220.220 208.67.222.222 valid=300s;
  resolver_timeout 5s;
  add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
  add_header X-Frame-Options SAMEORIGIN;
  add_header X-Content-Type-Options nosniff;
  add_header X-XSS-Protection "1; mode=block";
  ssl_certificate /etc/letsencrypt/live/greatful.com.br/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/greatful.com.br/privkey.pem;
  ssl_trusted_certificate /etc/letsencrypt/live/greatful.com.br/chain.pem;

  server_name greatful.com.br;

  root /var/www/great-landing;
  index index.html index.htm;
  location ~ /\.ht {
    deny all;
  }

}

server {
  listen 443 ssl;
  listen [::]:443 ssl;
  ssl_protocols TLSv1.2; # nginx v1.10.3
  ssl_prefer_server_ciphers on;
  #ssl_dhparam /etc/nginx/dhparam.pem;
  ssl_ciphers EECDH+AESGCM:EDH+AESGCM;
  ssl_ecdh_curve secp384r1;
  ssl_session_timeout  10m;
  ssl_session_cache shared:SSL:10m;
  ssl_session_tickets off;
  ssl_stapling on;
  ssl_stapling_verify on;
  resolver 208.67.220.220 208.67.222.222 valid=300s;
  resolver_timeout 5s;
  add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
  add_header X-Frame-Options SAMEORIGIN;
  add_header X-Content-Type-Options nosniff;
  add_header X-XSS-Protection "1; mode=block";
  ssl_certificate /etc/letsencrypt/live/greatful.com.br/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/greatful.com.br/privkey.pem;
  ssl_trusted_certificate /etc/letsencrypt/live/greatful.com.br/chain.pem;

  server_name *.greatful.com.br;

  return 301 https://greatful.com.br$request_uri;

}

